'''
 * CaRComp Execution Environment
 * 
 * Copyright (C) 2011 Taylor L. Riche
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
'''

from carcomp.directory import directory
import socket

local_name = socket.gethostname()
nikon = 'nikon.cs.utexas.edu'
leica = 'leica.cs.utexas.edu'
minolta = 'minolta.cs.utexas.edu'
pentax = 'pentax.cs.utexas.edu'
polaroid = 'polaroid.cs.utexas.edu'
olympus = 'olympus.cs.utexas.edu'

local_directory = directory.Directory()
local_directory.add_entry('client', nikon, 5000)
local_directory.add_entry('server0', leica, 6000)
local_directory.add_entry('server1', minolta, 6001)
local_directory.add_entry('agree0', pentax, 8000)
local_directory.add_entry('agree1', polaroid, 8001)
local_directory.add_entry('agree2', olympus, 8002)
local_directory.add_entry('agree0_feedback', pentax, 8020)
local_directory.add_entry('agree1_feedback', polaroid, 8021)
local_directory.add_entry('agree2_feedback', olympus, 8022)
#local_directory.add_entry('route', local_name, 8010)
#local_directory.add_entry('quorum_A', local_name, 8011)
#local_directory.add_entry('quorum_S', local_name, 6010)
#local_directory.add_entry('qprime', local_name, 6011)

local_directory.add_group('agrees')
local_directory.add_entry_to_group('agree0', 'agrees')
local_directory.add_entry_to_group('agree1', 'agrees')
local_directory.add_entry_to_group('agree2', 'agrees')

local_directory.add_group('agrees_2')
local_directory.add_entry_to_group('agree0_feedback', 'agrees_2')
local_directory.add_entry_to_group('agree1_feedback', 'agrees_2')
local_directory.add_entry_to_group('agree2_feedback', 'agrees_2')

local_directory.add_group('servers')
local_directory.add_entry_to_group('server0', 'servers')
local_directory.add_entry_to_group('server1', 'servers')

local_directory.agree_faults = 1
local_directory.server_faults = 1
local_directory.agree_q_thresh = local_directory.agree_faults + 1
local_directory.server_q_thresh = local_directory.server_faults

local_directory.package_root = '/u/riche/stepwise-ft/src/'

CLIENT_NAME = 'client'
SERVER_NAME = 'server'
SERVER0_NAME = 'server0'
SERVER1_NAME = 'server1'
AGREE0_NAME = 'agree0'
AGREE1_NAME = 'agree1'
AGREE2_NAME = 'agree2'

FEEDBACK = '_feedback'

BCAST_AGREES_NAME = 'BCAST;agrees'
BCAST_AGREES2_NAME = 'BCAST;agrees_2'
BCAST_SERVERS_NAME = 'BCAST;servers'

ROUTE_NAME = 'route'
QA_NAME = 'quorum_A'

QS_NAME = 'quorum_S'
QPRIME_NAME = 'qprime'
